home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Compilers⁄Interps
/
kevoSource
/
global.c
< prev
next >
Wrap
Text File
|
1993-05-08
|
3KB
|
122 lines
/* Kevo -- a prototype-based object-oriented language */
/* (c) Antero Taivalsaari 1991-1993 */
/* Some parts (c) Antero Taivalsaari 1986-1988 */
/* Global.c: Global variables and data areas */
#include "global.h"
/* 'rootContext' holds the names of all the system definitions */
/* 'userContext' is the root for user-given definitions */
/* 'lastContext' refers to the latest defined context in the system */
/* 'dummyContext' holds an "empty" context, which is used as a default
for some objects so as to allow them to be viewed by the browser.
*/
CONTEXT* rootContext = NIL;
CONTEXT* userContext = NIL;
CONTEXT* lastContext = NIL;
CONTEXT* dummyContext = NIL;
/* User task area pointer; denotes the currently executing task */
TASK** up;
/* Object pointer; denotes the previously executed high-level definition (handle) */
OBJECT* op;
/* Execution stack pointers */
int* dataSp;
int** returnSp;
int** contextSp;
/* Execution pointers */
/* Instruction pointer; denotes the next instruction to be executed */
/* Type should actually be 'OBJECT**' */
int** ip;
/* Environment buffers for setjmp */
jmp_buf p_inner; /* Preemptive inner interpreter longjump buffer */
jmp_buf c_inner; /* Cooperative inner interpreter longjmp buffer */
jmp_buf debug; /* Debugger longjump buffer */
/* Multitasking variables */
/* (Certain error handlers operate differently depending on this) */
int supervisor = FALSE; /* Are we currently in the supervisor mode */
int multitasking = TRUE; /* Is task switching allowed? */
int mtaskMode; /* Either PREEMPTIVE or COOPERATIVE */
int slice; /* Time slice counter */
int basePriority = 100; /* Base priority of newly created tasks */
TASK** firstTask; /* The first defined task in the system */
TASK** latestTask; /* The latest defined task in the system */
int taskCount = 1; /* Total number of tasks in the system */
int runningCount = 1; /* How many of them are running */
/* Critical region variables (see <| and |> in prim.c) */
/* Level of nested critical regions */
/* Incremented/decremented upon entering/leaving a protected region */
int inProtRegion = 0;
/* Stores the value of 'multitasking' upon entering a protected region */
int mtStore;
/* Tracing variables */
int traceMode = NOTRACE; /* Current tracing mode */
/* Debugger variables */
/* Needed in 'debugExit' and 'resume' */
TASK** debugTask = NIL; /* The task which caused a breakpoint */
int** rpStore; /* Return stack pointer temp store */
/* Standard files */
FILE* confile; /* Console file */
FILE* imgfile; /* Image (boot) file (initialized by 'main.c') */
/* String management buffer for several operations in 'port.c' */
char charbuffer[CHARBUFLEN];
/*
These are global references to certain operations.
They are initialized when the system is started, and must not be changed.
*/
/* Initialized in 'prim.c' */
OBJECT* oExit;
OBJECT* oLit;
OBJECT* oStrLit;
OBJECT* oContext;
OBJECT* oSharedVar;
OBJECT* oTaskVar;
OBJECT* oSharedConst;
OBJECT* oTaskConst;
OBJECT* oREF;
OBJECT* oVAR;
OBJECT* oCONST;
/* Initialized in 'image.c' */
OBJECT* oBoot;
OBJECT* oShell;
OBJECT* oError;
OBJECT* oUserRoot;